package com.tsd.jxc.buy.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tsd.core.utils.HlpUtils;
import com.tsd.jxc.JxcConstants;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @ClassName: JxcBuyStockInfoVo
 * @Description: TODO
 * @Author: Hillpool
 * @Date: 2022/11/25 10:49
 * @Version: 1.0
 */
public class JxcBuyStockInfoVo {

    private Integer order_type;

    private String code;

    @JsonFormat(pattern = "yyyy-MM-dd", locale = "zh", timezone = "GMT+8")
    private Date order_date;

    private String supplier_name;

    private String supplier_code;

    private String supplier_short_name;

    private String supplier_display;

    private BigDecimal total_amount;

    private Integer invoice_type;

    private Integer invoice_state;

    private String goods_name;

    private String spec_info;

    private String unit;

    private BigDecimal price;

    private BigDecimal qty;

    private BigDecimal amount;

    private BigDecimal lock_qty;

    private BigDecimal stock_qty;

    private BigDecimal sold_qty;

    private BigDecimal stock_amount;

    public Integer getOrder_type() {
        return order_type;
    }

    public void setOrder_type(Integer order_type) {
        this.order_type = order_type;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Date getOrder_date() {
        return order_date;
    }

    public void setOrder_date(Date order_date) {
        this.order_date = order_date;
    }

    public String getSupplier_name() {
        return supplier_name;
    }

    public void setSupplier_name(String supplier_name) {
        this.supplier_name = supplier_name;
    }

    public String getSupplier_code() {
        return supplier_code;
    }

    public void setSupplier_code(String supplier_code) {
        this.supplier_code = supplier_code;
    }

    public String getSupplier_short_name() {
        return supplier_short_name;
    }

    public void setSupplier_short_name(String supplier_short_name) {
        this.supplier_short_name = supplier_short_name;
    }

    public String getSupplier_display() {
        return supplier_display;
    }

    public void setSupplier_display(String supplier_display) {
        this.supplier_display = supplier_display;
    }

    public BigDecimal getTotal_amount() {
        return total_amount;
    }

    public void setTotal_amount(BigDecimal total_amount) {
        this.total_amount = total_amount;
    }

    public Integer getInvoice_type() {
        return invoice_type;
    }

    public void setInvoice_type(Integer invoice_type) {
        this.invoice_type = invoice_type;
    }

    public Integer getInvoice_state() {
        return invoice_state;
    }

    public void setInvoice_state(Integer invoice_state) {
        this.invoice_state = invoice_state;
    }

    public String getGoods_name() {
        return goods_name;
    }

    public void setGoods_name(String goods_name) {
        this.goods_name = goods_name;
    }

    public String getSpec_info() {
        return spec_info;
    }

    public void setSpec_info(String spec_info) {
        this.spec_info = spec_info;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getQty() {
        return qty;
    }

    public void setQty(BigDecimal qty) {
        this.qty = qty;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getLock_qty() {
        return lock_qty;
    }

    public void setLock_qty(BigDecimal lock_qty) {
        this.lock_qty = lock_qty;
    }

    public BigDecimal getStock_qty() {
        return stock_qty;
    }

    public void setStock_qty(BigDecimal stock_qty) {
        this.stock_qty = stock_qty;
    }

    public BigDecimal getSold_qty() {
        return sold_qty;
    }

    public void setSold_qty(BigDecimal sold_qty) {
        this.sold_qty = sold_qty;
    }

    public BigDecimal getStock_amount() {
        return stock_amount;
    }

    public void setStock_amount(BigDecimal stock_amount) {
        this.stock_amount = stock_amount;
    }

    public String getInvoice_info() {
        if (!HlpUtils.isEmpty(this.getInvoice_type())) {
            if (this.getInvoice_type() == JxcConstants.INVOICE_TYPE_NO_NEED) {
                return "无进项发票";
            }
            if (this.getInvoice_type() == JxcConstants.INVOICE_TYPE_DZFP) {
                if (JxcConstants.INVOICE_STATE_WAIT == this.getInvoice_state()) {
                    return "待申请【普】";
                }
                if (JxcConstants.INVOICE_STATE_DOING == this.getInvoice_state()) {
                    return "已申请【普】";
                }
                return "已收普票";
            }
            if (this.getInvoice_type() == JxcConstants.INVOICE_TYPE_ZYFP) {
                if (JxcConstants.INVOICE_STATE_WAIT == this.getInvoice_state()) {
                    return "待申请【专】";
                }
                if (JxcConstants.INVOICE_STATE_DOING == this.getInvoice_state()) {
                    return "已申请【专】";
                }
                return "已收专票";
            }
        }
        return null;
    }
}
